package framework;

import framework.server.ServerException;

/**
 * Presents the service of the framework
 *
 * @author	Orlin Tomov
 * @version	0.2
 *
 */
public interface Service extends Runnable {

	/**
	 * Returns the name of the service. 
	 *
	 * @return	service name
	 */
	public String getServiceName();

	/**
	 * Prepare service
	 * @throws ServerException 
	 */
	public void init() throws ServerException;

	/**
	 * Returns running status
	 *
	 * @return	running status of the service
	 * @see	#starting()
	 * @see	#stoping()
	 */
	public boolean isRunning();

	/**
	 * Starts the service
	 *
	 * @see	#isRunning()
	 * @see	#stoping()
	 */
	public void starting();

	/**
	 * Stops the service
	 *
	 * @see	#isRunning()
	 * @see	#starting()
	 */
	public void stoping();

	/**
	 * Returns the info of the service. 
	 *
	 * @return	service info
	 */
	public String info();

}
